//==============================================================================
//File:	CObject.h
//Desc: Holds all of the object/mesh classes.  May not be necessary later but
//		for now here it is :)  Basically the same as demo 1.1 with some changes
//	
//	I will be commenting the hell out of every file.  We can build after each
//	lesson and delete what conflicts.  This is the working project.
//Copyright this shit.  Asad Aslam, Aaron Raines. (Demo Purposes) :)
//=============================================================================

#ifndef	_COBJECT_H_
#define	_COBJECT_H_

//============================================================================
//CObject Includes
//============================================================================

#include "Main.h"

//============================================================================
//Class Declarartions
//============================================================================

//============================================================================
//Name:	CVertex (class)
//Desc:	This holds all of the vertex data.
//============================================================================
class CVertex
{
public:
	//======================================================================
	//Constructors and Destructors
	//======================================================================
	CVertex(float fX, float fY, float fZ, ULONG ulDiffuse = 0xFF000000)
	{
		x = fX; 
		y = fY; 
		z = fZ; 
		Diffuse = ulDiffuse;
	}

	CVertex()
	{
		x = 0.0f; 
		y = 0.0f; 
		z = 0.0f; 
		Diffuse = 0xFF000000; 
	}

	//====================================================================
	//Public Variables
	//===================================================================
	float		x;			//Vertex Position X
	float		y;			//Vertex Position Y
	float		z;			//Vertex Position Z
	ULONG		Diffuse;	//Diffuse vertex color component
};

//========================================================================
//Name:	CPolygon
//Desc:	This holds all polygon vertex data
//=======================================================================
class CPolygon
{
public:
	//====================================================================
	//Constructors and Destructors
	//====================================================================
	CPolygon(USHORT VertexCount);
	CPolygon();
	virtual ~CPolygon();

	//====================================================================
	//Public Functions
	//===================================================================
	long AddVertex(USHORT Count = 1);

	//===================================================================
	//Public Variables
	//===================================================================
	USHORT			m_nVertexCount;		//Number of vertices
	CVertex			*m_pVertex;			//Vertex array
};

//-----------------------------------------------------------------------------
// Name : CMesh (Class)
// Desc : Basic mesh class used to store individual mesh data.
//-----------------------------------------------------------------------------
class CMesh
{
public:
    //-------------------------------------------------------------------------
	// Constructors & Destructors for This Class.
	//-------------------------------------------------------------------------
             CMesh( ULONG Count );
	         CMesh();
	virtual ~CMesh();

	//-------------------------------------------------------------------------
	// Public Functions for This Class
	//-------------------------------------------------------------------------
    long        AddPolygon( ULONG Count = 1 );

    //-------------------------------------------------------------------------
	// Public Variables for This Class
	//-------------------------------------------------------------------------
    ULONG       m_nPolygonCount;        // Number of polygons stored
    CPolygon  **m_pPolygon;             // Simply polygon array.

};

//=======================================================================
class CObject
{
public:
	//====================================================================
	//Constructors and Destructors
	//===================================================================
	CObject(CMesh *pMesh);
	CObject();

	//===================================================================
	//Public Variables
	//===================================================================
	D3DXMATRIX	m_worldMatrix;		//object world matrix
	CMesh		*m_pMesh;			//Mesh we are instancing
};

#endif //_OBJECT_H_